Skip to content

WO20: the reverse-mode golden gate — ts replay (#286) - #141

Merged
ronaldtse merged 1 commit into
mainfrom
wo20-reverse-gate-ts
Nov 16, 2026
Merged

ronaldtse merged 1 commit into
mainfrom
wo20-reverse-gate-ts

Conversation

@ronaldtse

Copy link
Copy Markdown
Contributor

Summary

WO20 (#286, interscript/maps): the reverse-mode golden gate — the ts replay side. The rs capture (interscript-rs#32) records tests/golden/isc-reverse.jsonl (10,024 rows over 313 maps) once; this branch replays it byte-identically here.

  • test/golden-isc-reverse.test.ts mirrors golden-isc-wf0.test.ts: load every row's map, reverse it (dependencies reverse with it — the InterscriptRuntime#reverse closure walk), execute the reversed main stage on the row's src, require byte-identical output. Errors map to null, the canonical capture marker. No adopting-set exemption: the reverse golden has no adoption flow.
  • The rs reverse fixtures (tests/reverse_maps, siblings of the golden file) join the bundled sources FIRST-WINS after the corpus, so a corpus map shadows a same-named fixture exactly like the capture's load path.

Verification

  • 10,024/10,024 rows byte-identical against the sibling checkouts (GOLDEN_ROOT=<workspace> npx vitest run test/golden-isc-reverse.test.ts).
  • Prettier + eslint clean on the new spec.
  • Cross-runtime note: on the 125 maps where the engines still diverge from the rs reference (the ruby-engine family fires reversed zero-width-from rules — e.g. the ALA-LC Arabic rule-8a word-initial-hamzah deletion — as insertions where the rs engine leaves them inert, plus reversed parallel selection order), rows are excluded upstream by the rs-side manifest tests/golden/reverse-divergent-maps.txt — shrink-to-zero as the engines converge.

Companion branches: wo20-reverse-gate-rs (capture + golden), wo20-reverse-gate-ruby (ruby + py replay), wo20-reverse-gate-ci (maps workflow wiring).

test/golden-isc-reverse.test.ts mirrors golden-isc-wf0.test.ts for the
rs reverse golden (interscript-rs tests/golden/isc-reverse.jsonl,
10,024 rows over 313 maps, captured once by iscrs capture --reverse):
load every row's map, reverse it (dependencies reverse with it, the
InterscriptRuntime#reverse closure walk), execute the reversed main
stage on the row's src, require byte-identical output. Errors map to
null, the canonical capture marker; no adopting-set exemption. The rs
reverse fixtures (tests/reverse_maps, siblings of the golden) join the
bundled sources FIRST-WINS after the corpus, so a corpus map shadows a
same-named fixture like the capture's load path.

Verified locally against the sibling checkouts: 10,024/10,024 rows
byte-identical. Maps the engines still diverge on live in the rs
manifest (tests/golden/reverse-divergent-maps.txt) — shrink-to-zero
follow-up.
@ronaldtse
ronaldtse merged commit a08c317 into main Nov 16, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant